//index.js
//获取应用实例
const app = getApp()
const Api = require("../../../utils/api.js").API
const Store = require("../../../utils/store.js").store
// const codeZ = require("../../../utils/util.js")



Component({
  options: {
    multipleSlots: true
    },
    properties:{
      cellList:Object,
     
      type:{
          value:'0',
          type:String
      },
      typeZhi:{
          value:0,
          type:Number
      }
     
    },
   
  data: {
    code:'',
      screenWidth:375
  },
   ready() {
       
       
     
   },
  methods:{
      jumpDetail:function(){
        
          if(this.properties.typeZhi == 3){
              return
          }
          var token = Store.getStore('token');
         
                 
            if (!token) { 
              wx.navigateTo({
                   url: '../login/index',
              })
              return;           
            }
          var goods = this.properties.cellList;                 
            var str =  goods;
         
          wx.navigateTo({
                   url: '../shopDetail/index',
                     success: function(res) {
                       // 通过eventChannel向被打开页面传送数据
                       res.eventChannel.emit('acceptDataFromOpenerPage', { data:str })
                     }
             })
         
          
      }
  },
   ready(){
    
       if(this.properties.type == "1"){
           this.setData({
               screenWidth:app.globalData.screenWidth,
           })
       }
      
        
    },
 
  
  
 
})
